import { ipcMain } from "electron";
import { EntityFactory } from "./entiry";

export class down {
  constructor() {}
  static async downFile() {
    const entity = EntityFactory.createEntiry();
    // entity.performOperation()
    const magnet =
      "magnet:?xt=urn:btih:88594AAACBDE40EF3E2510C47374EC0AA396C08E&dn=bbb_sunflower_1080p_30fps_normal.mp4&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce&ws=http%3a%2f%2fdistribution.bbb3d.renderfarming.net%2fvideo%2fmp4%2fbbb_sunflower_1080p_30fps_normal.mp4";
    ipcMain.handle("manage", async (event, ...args) => {
      const { RPC } = await entity;
      const guid = await RPC.call("addUri", magnet);
      console.log("guid", guid);
    });
  }
}
